post-cover
VS Code -> Nvim
Making the switch
Written Tue Sep 12 2023
By Michael Freno
190 Hits
VS Code -> Nvim
Making the switch

Fully moving to vim.

I have been trying to move towards vim for a little while, using vim bindings in VS Code, however I wasn’t learning as fast as I wanted. I often ending up not using them unless I could remind myself to do so as at start it was slower than using vs code/macos keyboard shortcuts.

So to solve the slow learning curve I have decided to make the dive and go fully into Vim. My setup is as follows:

  1. Neovim

  2. Alacritty I am using this to have consistency across platforms, as I use macOS as my main machine (for now 👀) and windows occasionally and trying out Linux (Debian & Ubuntu) and would like to keep everything as consistent as possible, mine is here. Additionally I have the following script run as a cron job every 5 minutes to switch alacritty's color theme at a specific time

#based on system time
FILE=~/.config/alacritty/alacritty.yml
MOCHA="catppuccin-mocha"
LATTE="catppuccin-latte"

HOUR=$(date +%H)

if (( 10#$HOUR >= 7 && 10#$HOUR < 17 )); then
    sed -i '' "s|$MOCHA|$LATTE|g" $FILE
else
    sed -i '' "s|$LATTE|$MOCHA|g" $FILE
fi

Edit: I changed the theme to depend on system theme instead of system time, additionally I added a transparency to only the dark mode/mocha, as it made the light mode/mocha difficult to read.

#based on system theme
FILE=~/.config/alacritty/alacritty.yml
MOCHA="catppuccin-mocha"
LATTE="catppuccin-latte"

IS_DARK_MODE=$(osascript -e 'tell application "System Events" to tell appearance preferences to return dark mode')

CURRENT_THEME=$(grep -o "$LATTE\|$MOCHA" "$FILE")

if [[ $IS_DARK_MODE == "true" ]]; then
    # If current theme is not MOCHA, then switch to MOCHA
    if [ "$CURRENT_THEME" != "$MOCHA" ]; then
        sed -i '' "s|$LATTE|$MOCHA|g" $FILE
        sed -i '' "s|opacity: 1.0|opacity: 0.95|g" $FILE
    fi
else
    # If current theme is not LATTE, then switch to LATTE
    if [ "$CURRENT_THEME" != "$LATTE" ]; then
        sed -i '' "s|$MOCHA|$LATTE|g" $FILE
        sed -i '' "s|opacity: 0.95|opacity: 1.0|g" $FILE
    fi
fi
  1. Tmux - find my config here

  2. Kickstart.nvim (to get me started)

  3. My current init.lua

I spent about a day and a half to get to this point, including research, trying out different terminal emulators, tried nvchad. Moving forward I’m going to be running with this setup for at least a few months. I don’t want to get trapped into constantly refining my setup. It works, looks nice and I’m excited to get moving blazingly fast🔥

And here is what it looks like:

light mode:

dark mode:

Comments
No Comments Yet